<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Kalnoy\Nestedset\NodeTrait;
use Spatie\Permission\Models\Role;

//引入NodeTrait

class Menu extends Model
{
    use HasFactory, NodeTrait;

    protected $guarded = [];

    public function role()
    {
        return $this->belongsTo(Role::class);
    }

}
